<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<!-- Bootstrap core CSS -->
<link href="${base}/assets/libs/bootstrap/3.3.7/css/bootstrap.css"
	rel="stylesheet">
</head>
<body role="document">
	<input type="hidden" id="base" value="${base}">
	<!-- Fixed navbar -->
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div id="navbar" class="navbar-collapse collapse">
				<ul class="nav navbar-nav">
					<li><a href="${base}/">首 页</a></li>

					<li><a href='${base}/user/register'>注 册</a></li>
					<li class="active"><a href='${base}/user/login'>登 录</a></li>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</nav>
	<div class="container theme-showcase" role="main">
		<div class="row">
			<div class="col-md-4 col-md-offset-4">
				<div class="page-header">
					<h2>
						<br /> <br />请登录
					</h2>
				</div>
				<form method="post" action="${base}/user/login">
					<div class="form-group ">
						<label for="email">用户名</label> <input name="username" type="text"
							class="form-control" placeholder="电子邮箱" id="email" value="">
						<span style="color: red; font-weight: 900" id="errorEmailSpan"></span>
					</div>
					<div class="form-group ">
						<label for="password">密码</label> <input name="password"
							type="password" class="form-control" id="password"
							placeholder="密码" maxlength="10" value=""> <span
							style="color: red; font-weight: 900" id="errorPasswordSpan"></span>
					</div>
					<div class="form-group " id="captchaVcode">
						<label for="vcode">验证码</label><input type="text" name="vcode" id="vcode"
							class="form-control" placeholder="验证码"> <img id="captcha" src="${base}/user/getGifCode" />
					</div>
					<div class="row">
						<div class="col-md-4">
							<p>
								<input type="checkbox" name="rememberMe" value="1" id="rememberMe"> 记住我
							</p>
						</div>
						<div class="col-md-8">
							<p class="text-right">
								<a href='${base}/user/forget'>忘记密码?</a>
							</p>
							<p style="color: red; font-weight: 900"></p>
						</div>
					</div>
					<button type="button" id="login" class="btn btn-primary">登录</button>
					<a href='${base}/user/register' class="btn btn-info" role="button">注册</a>
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="${base}/assets/libs/jquery/1.12.4/jquery.js"></script>
	<script type="text/javascript"
		src="${base}/assets/libs/bootstrap/3.3.7/js/bootstrap.js"></script>
	<script type="text/javascript" src="${base}/assets/js/login.js"></script>
	<script>
		jQuery(document).ready(function() {
			//验证码
			$("#captchaVcode").on("click", 'img', function() {
				/**动态验证码，改变地址，多次在火狐浏览器下，不会变化的BUG，故这样解决*/
				var i = new Image();
				i.src = '${base}/user/getGifCode?' + Math.random();
				$(i).replaceAll(this);
			});

		});
	</script>
</body>
</html>
